import Konva from 'konva';

export class IKonva {
  public stage!: Konva.Stage;
  public bgLayer!: Konva.Layer;//静态背景层
  public centLayer!: Konva.Layer;//中间渲染层
  public topLayer!: Konva.Layer;//动态渲染层
  public layerManager!: Map<string,Konva.Layer>;
  constructor() {
    
  }
  initLayer(){
    const layerList = ['bgLayer','centerLayer', 'topLayer'];
    layerList.forEach((item)=>{
      this.topLayer = new Konva.Layer();
      this.stage.add(this.topLayer);
      this.topLayer.draw();
    })
  }
  init(id:string) {
    this.stage = new Konva.Stage({
      container: id,
      width: 1000,
      height: 1000,
    });

    this.initLayer();
  }
}

